using UnityEngine;
using System.Collections;

public class PropObjectInfo : MonoBehaviour
{
public Texture2D iconTexture;
public string nameOfObj = "Put your Object name";
public inventory TheInvty; //represents a reference to our inventory


    public string propname;

    void OnMouseOver(){
	    //~ if( GetComponent<Equippable> != null){
		    //~ if( GetComponent<Equippable>.isEquipped())
			    //~ return;
	    //~ }
         
	    //ToggleAlpha(0.3f, 1.0f);
        Color curcolor = renderer.material.color;
        curcolor.a = Random.value;
       

	    if(Input.GetMouseButtonDown(0)){
			 
			curcolor.a = 1;
			print ("TheInvty.SaveObjectInInventory");
            TheInvty.GetComponent<inventory>().SaveObjectInInventory(transform.gameObject);	
	    }
        renderer.material.color = curcolor;
         
    }

    void OnMouseExit(){
	   		Color curcolor = renderer.material.color;
			curcolor.a = 1;
            renderer.material.color = curcolor;
    } 
}